// user_app.c
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>

struct user_data {
    int id;
    char msg[64];
};

int main() {
    int fd = open("/dev/myworkdev", O_WRONLY);
    if (fd < 0) {
        perror("open");
        return 1;
    }

    struct user_data data = {
        .id = 42,
        .msg = "Hello from user space"
    };

    write(fd, &data, sizeof(data));

    close(fd);
    return 0;
}
